home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
3458A.ZIP
/
AMAC44A.ZIP
/
MIS001.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
19KB
|
465 lines
* mis001.qm
* Miscellaneous Cursor and Line Position Macros
* Written By Tom Hogshead
* [ See MISCxx.QM For Use ]
* 6/20/92
* Key Subfile Description
* ===== ========= =================================================
* ^F5_ Del Chars To Begin of Line, Plus White Space |chg
* ^F6_ Del Chars To Begin of Line, But Not White Space
*
* Copy Current or Blocked Lines
* ^e ├─ From Previous To Current Window
* ^x └─ From Current to Next Window
*
* @9 Find Word At Cursor In File Below
* @8 Move To First Word Delimiter After WordLeft
* @7 Move To First Word Delimiter After WordRight
* @6 Move To FirstNonWhite Character After WordLeft
* @5 Move To FirstNonWhite Character After WordRight
* ^a_ Move To First Character Of Wordleft
* ^f_ Move To First Character Of Wordright
* @4 WordLeft To FirstNonWhite Character Of Word
* @3 WordRight To FirstNonWhite Character Of Word
* @2 WordLeft Not Stop at End of Line
* @1 WordRight Not Stop at End of Line
* @j Join Lines with Single Space at Join Point
* ^F7_ Align Current Line In Designated Column
* ^F8_ Split Line with Split Word In Same Column
* ^F9_ Split Line with Split Word In Designated Column
*
* ^w_ Scroll UP Cursor Bar Stays Fixed
* ^z_ Scroll DOWN Cursor Bar Stays Fixed
* @w Scroll UP Two Windows In Sync
* @z Scroll DOWN Two Windows In Sync
*
* @PgUp Page Up By Paragraphs, Modified "Page Up"
* @PgDn Page Down By Paragraphs, Modified "Page Dn"
*
* #F4__ Position Cursor In Column At Top of Paragraph
* #F5__ Position Cursor In Column At Top of Paragraph
* #F6__ Position Cursor In Column At Bottom of Paragraph
*
* #F5 {e:\up\rfr002} Move Cursor First Letter of Word at Cursor
* #F8 {e:\up\rfr002} Short version of #F5
* #F7 {e:\up\rfr002} Move Cursor to First Non-White Character of Line
*
* {e:\up\MISC*} Return To MISCxx.QM
*
*-- eoi
* M A C R O S - Some macros require v2.15
* ------------------------------------------
* @(1) WordRight Not Stop at End of Line
* ------------------------------------------
@1 macrobegin wordright isendline jfalse END wordright END:
* 10 bytes Mon 10-28-1991 14:16:22 (TH @1)
*
* ------------------------------------------
* @(2) WordLeft Not Stop at End of Line
* ------------------------------------------
@2 macrobegin wordleft isendline jfalse END wordleft END:
* 10 bytes Mon 10-28-1991 14:16:22 (TH @2)
*
* -----------------------------------------------------
* @(3) WordRight To FirstNonWhite Character Of Word
* -----------------------------------------------------
*TEST* ├TEST├ TEST ▓├TEST├
* ├TEST├ TEST ▓├TEST├
@3 macrobegin setscreenoff
10: isendline jfalse 11 cursordown firstnonwhite jump END
11: splitline #173 cursordown begline firstnonwhite jtrue 12
cursorup endline cursorleft delch joinline cursorright jump 10
12: cursorup endline cursorleft delch joinline
21: splitline #173 cursordown begline firstnonwhite jfalse 22
cursorup endline cursorleft delch joinline cursorright jump 21
22: cursorup endline cursorleft delch joinline
END:
*
* 69 bytes Tue 01-07-1992 21:19:49 (TH @3, to DK #0/16964, Ver 1)
* 60 bytes Wed 01-08-1992 12:44:06 (TH @3, removed second endline test Ver 2)
*
* -----------------------------------------------------
* @(4) WordLeft To FirstNonWhite Character Of Word
* -----------------------------------------------------
*TEST* ├TEST├ TEST ▓├TEST├
* ├TEST├ TEST ▓├TEST├
@4 macrobegin setscreenoff wordleft
11: splitline #173 cursordown begline firstnonwhite jtrue 12
cursorup endline cursorleft delch joinline cursorleft jtrue 11
jump end
12: cursorup endline cursorleft delch joinline cursorright
END:
*
* 33 bytes Wed 01-08-1992 12:48:04 (TH @4 Ver 1)
*
* -----------------------------------------------------
* @(5) Move To FirstNonWhite Character After WordRight
* -------------- Version #1 ---------------------------
*TEST* ├TEST├ TEST ▓├TEST├
* ├TEST├ TEST ▓├TEST├
@5 macrobegin setscreenoff wordright
10: isendline jfalse 11 cursordown firstnonwhite jump END
11: splitline #173 cursordown begline firstnonwhite jtrue 12
cursorup endline cursorleft delch joinline cursorright jump 10
12: cursorup endline cursorleft delch joinline
END:
*
* 38 bytes Wed 01-08-1992 16:16:48 (TH @5)
*
* -----------------------------------------------------
* @(6) Move To FirstNonWhite Character After WordLeft
* -------------- Version #2 ---------------------------
*TEST* ├TEST├ TEST ▓├TEST├
* ├TEST├ TEST ▓├TEST├
@6 macrobegin setscreenoff
wordleft wordleft isendline jfalse END1 wordleft END1: *|
21: splitline #173 cursordown begline firstnonwhite jtrue 22
isemptyline jtrue 22
cursorup endline cursorleft delch joinline cursorright jump 21
22: cursorup endline cursorleft delch joinline
END:
*
* 38 bytes Wed 01-08-1992 17:25:34 (TH @6)
* 39 bytes Sun 01-12-1992 14:47:07 (TH @6, added second wordleft, Ver 2)
*
* ----------------------------------------------------------------------
* @(7) Move To First Word Delimiter After WordRight
* ----------------------------------------------------------------------
*TEST* ├TEST├ TEST ▓├TEST├
* ├TEST├ TEST ▓├TEST├
@7 macrobegin
wordright endline jtrue NO_EOL
wordright jump GOTOPOS
NO_EOL: prevposition
GOTOPOS: markword gotoblockend unmarkblock
*
* 17 bytes Mon 10-22-1990 11:32:32
*
* ----------------------------------------------------------------------
* @(8) Move To First Word Delimiter After WordLeft
* ----------------------------------------------------------------------
*TEST* ├TEST├ TEST ▓├TEST├
* ├TEST├ TEST ▓├TEST├
@8 macrobegin
wordleft wordleft endline jtrue NO_EOL
wordleft jump GOTOPOS
NO_EOL: prevposition
GOTOPOS: markword gotoblockend unmarkblock
*
* 18 bytes Mon 10-22-1990 11:32:21
*
* -------------------------------------------
* @(9) Find Word At Cursor In File Below
* -------------------------------------------
@9 macrobegin markword jfalse END copy find paste return "i" return END:
*
* 15 bytes Thu 01-09-1992 08:21:18 (TH @9)
*
* ----------------------------------------------------------------------
* @(j) Join Lines with Single Space at Join Point, by John Goodman
* ----------------------------------------------------------------------
@j macrobegin
endline cursorright cursorright joinline cursorleft delrtword
* 10 bytes Fri 07-26-1991 19:30:39 (JG @j in RFRMxx.QM rfr007.qm)
*
* ----------------------------------------------------------------------
* ^(F7_) Align Current Line In Designated Column
* ----------------------------------------------------------------------
^F7 macrobegin
begline splitline gotocolumn Pause return
cursorright joinline cursorleft delrtword
* 13 bytes Fri 11-15-1991 13:01:04 (TH ^F7)
*
* ----------------------------------------------------------------------
* ^(F8_) Split Line with Split Word In Same Column as Current Line
* ----------------------------------------------------------------------
^F8 macrobegin
dupline cursorup deltoeol cursordown
splitline splitline delline joinline
* 12 bytes Fri 11-15-1991 13:02:05 (TH ^F8)
* aaa bbb
*
* ----------------------------------------------------------------------
* ^(F9_) Split Line with Split Word In Designated Column
* ----------------------------------------------------------------------
^F9 macrobegin
splitline splitline cursordown
gotocolumn Pause return joinline
* 11 bytes Fri 11-15-1991 11:17:45 (TH ^F9)
* aaa bbb
*
* ----------------------------------------------------------------------
* ^(F5_) Delete All Characters To Begin of Line, PLUS White Space
* ----------------------------------------------------------------------
^F5 macrobegin
splitline delline begline
* 10 bytes Mon 11-25-1991 09:35:32 (TH ^F5)
* 7 bytes Sat 06-20-1992 12:59:02 (TH ^F5, shortened)
*
* ----------------------------------------------------------------------
* ^(F6_) Delete All Characters To Begin of Line, But Not White Space
* ----------------------------------------------------------------------
^F6 macrobegin
splitline delline insertline joinline
* 8 bytes Mon 11-25-1991 09:35:22 (TH ^F6)
*
*---------------------------------------------------
* @(PgUp) Page Up By Paragraphs, Modified "Page Up"
*---------------------------------------------------
* This macro does a modified page UP with the cursor at the top of the
* screen at the beginning of a paragraph, the first paragraph on the
* screen being the last parapgraph which might not have been fully
* visible on the top of previous screen. This is handy for getting to
* and from paragraphs during editing or viewing.
177 MacroBegin PageUp PrevPara BegLine Maketopofscreen
*
* 8 bytes Thu 02-21-1991 14:23:43
*
*-----------------------------------------------------
* @(PgDn) Page Down By Paragraphs, Modified "Page Dn"
*----------------------------------------------------
* This macro does a modified page DOWN with the cursor at the top of
* the screen on the end of the last paragraph which was not fully
* visible on the previous screen. This is handy for getting to and from
* paragraphs during editing or viewing.
176 MacroBegin PageDown EndPara BegLine Maketopofscreen
*
* 8 bytes Thu 02-21-1991 19:11:14
*
* ----------------------------------------------------------------------
* ^(w_) Scroll Up, Cursor Bar Stays Fixed
* ----------------------------------------------------------------------
^w lineup
*
* 6 bytes Fri 02-22-1991 17:01:18
* 0 bytes Sat 08-24-1991 16:30:39 (TH ^w)
*
* ----------------------------------------------------------------------
* ^(z_) Scroll Down, Cursor Bar Stays Fixed
* ----------------------------------------------------------------------
^z linedown
*
* 6 bytes Fri 02-22-1991 17:01:18
* 0 bytes Sat 08-24-1991 16:31:11 (TH ^z)
*
* ----------------------------------------------------------------------
* @(w) Scroll Two Windows Up In Sync
* ----------------------------------------------------------------------
@w macrobegin Lineup nextwindow Lineup prevwindow
*
* 10 bytes Fri 02-22-1991 16:52:31
* 8 bytes Sat 08-24-1991 16:26:08 (TH @w, written by Richard BlackBurn)
*
* ----------------------------------------------------------------------
* @(z) Scroll Two Windows Down In Sync
* ----------------------------------------------------------------------
@z macrobegin Linedown nextwindow Linedown prevwindow
*
* 10 bytes Fri 02-22-1991 16:52:39
* 8 bytes Sat 08-24-1991 16:27:03 (TH @z, written by Richard BlackBurn)
*
* ----------------------------------------------------------------------
* ^(e) Copy To Current Window:
* - Blocked Line(s) From Previous Window With Block, or
* - Lines In Previous Window Marked at Pause, or
* - Cursor Line in Previous Window if No Block
* ----------------------------------------------------------------------
* This macro will copy:
* - Single or multiple lines in either window marked as a block
* to the next window, or
* - Lines in the previous window marked at pause to the current
* window, or
* - Cursor line in previous window if no block is marked to the
* current window.
* If a block is marked in either window before invoking this macro, the
* block (open or closed before invoking) will be copied to the current
* window.
* If a block is not marked in either window before invoking this macro,
* the cursor moves to the previous window after the macro is invoked.
* At the pause cursor to the end of the block to be copied, press
* <enter>, and the block will be copied to the next window.
* If the cursor position is not changed up or down at the pause, the
* cursor line in the previous window from which the macro is
* invoked will be copied to the next window.
* This macro, used in conjunction with macros @w, @z, ^w and ^z, is
* useful for quickly moving contents from one window to another.
^e macrobegin
prevwindow * Go to previous window
gotoblockbeg jtrue OK * Test if any marked block
markline * If no block, mark cursor line and
* pause * cursor to end of block, press <enter>
OK: copy nextwindow paste * Paste marked block in unmarked window
*
* 14 bytes Sat 05-09-1992 15:38:48 (TH ^e)
*
* ----------------------------------------------------------------------
* ^(x) Copy To Next Window:
* - Blocked Line(s) From Window With Block, or
* - Lines In Current Window Marked at Pause, or
* - Cursor Line in Current Window if No Block
* ----------------------------------------------------------------------
* This macro will copy:
* - Single or multiple lines in either window marked as a block
* to the next window, or
* - Lines in the current window marked at pause to the next
* window, or
* - Cursor line in current window if no block is marked to the
* next window.
* If a block is marked in either window before invoking this macro, the
* block (open or closed before invoking) will be copied to the next
* window.
* If a block is not marked in either window before invoking this
* macro, the cursor remains in the window in which the macro is
* invoked. At the pause cursor to the end of the block to be copied,
* press <enter>, and the block will be copied to the next window.
* If the cursor position is not changed up or down at the pause, the
* cursor line in the window in which the macro is invoked will be
* copied to the next window.
* This macro, used in conjunction with macros @w, @z, ^w and ^z, is
* useful for quickly moving contents from one window to another.
^x macrobegin
nextwindow * Go to next window, closes block if open
prevwindow * Return to starting window
gotoblockbeg jtrue OK * Test if any marked block
markline * If no block, mark cursor line and
* pause * cursor to end of block, press <enter>
OK: copy nextwindow paste * Paste marked block in unmarked window
*
* 15 bytes Sat 05-09-1992 12:07:42 (TH ^x)
*
* ------------------------------------------------------------------
* #(f4__) Position Cursor In Column At Top of Paragraph (R. Blackburn)
* ------------------------------------------------------------------
#f4 macrobegin
MarkCharacter * save our place
PrevPara * goto start of paragraph
MarkCharacter * make it a block
GotoBlockEnd * go back to our place
MarkLine * and convert to line block
* this is because
GotoBlockBeg * block begin on a line block is
* just the top of the block
* at whatever block you are in
UnMarkBlock * un mark the block
*
* 11 bytes Thu 03-21-1991 19:23:29
*
* ------------------------------------------------------------------
* #(f5__) Position Cursor In Column At Top of Paragraph
* ------------------------------------------------------------------
* Here's an alternate version shortening Richard Blackburn's ^f5 one
* byte. Except for screen position, both do the same thing. Richard
* had the neat idea that got me thinking!
#f5 Macrobegin
MarkLine * save our place
PrevPara * goto start of paragraph
MarkLine * make it a block
PrevPosition * go back to where we started
GotoBlockBeg * block begin on a line block is
* just the top of the block
* at whatever block you are in
UnMarkBlock * un mark the block
*
* 10 bytes Thu 03-21-1991 19:23:40
*
* ------------------------------------------------------------------
* #(f6__) Position Cursor In Column At Bottom of Paragraph
* ------------------------------------------------------------------
#f6 Macrobegin
MarkLine * save our place
EndPara * goto end of paragraph
MarkLine * make it a block
PrevPosition * go back to where we started
GotoBlockEnd * block end on a line block is
* just the bottom of the block
* at whatever block you are in
UnMarkBlock * un mark the block
*
* 10 bytes Sun 03-24-1991 22:51:35
*
* ----------------------------------------------------------------------
* ^(a_) Moves Cursor To First Character Of Wordleft
* ----------------------------------------------------------------------
^a macrobegin
wordleft * Move wordleft
endline * Test if on eol
jtrue NO_EOL * If not on eol, tests true
wordleft * If on eol, goto wordleft
jump GOTOPOS * End macro
NO_EOL: prevposition * If not at eol, return to
GOTOPOS: * where we were
*
* 14 bytes Mon 10-22-1990 11:53:14
*
* ----------------------------------------------------------------------
* ^(f_) Moves Cursor To First Character Of Wordright
* ----------------------------------------------------------------------
^f macrobegin
wordright * Move wordright
endline * Test if on eol
jtrue NO_EOL * If not on eol, tests true
wordright * If on eol, goto wordright
jump GOTOPOS * End macro
NO_EOL: prevposition * If not at eol, return to
GOTOPOS: * where we were
*
* 14 bytes Mon 10-22-1990 11:53:03